<?xml version="1.0" encoding="utf-8"?>
<!--
                                                                                     
 h       t     t                ::       /     /                     t             / 
 h       t     t                ::      //    //                     t            // 
 h     ttttt ttttt ppppp sssss         //    //  y   y       sssss ttttt         //  
 hhhh    t     t   p   p s            //    //   y   y       s       t          //   
 h  hh   t     t   ppppp sssss       //    //    yyyyy       sssss   t         //    
 h   h   t     t   p         s  ::   /     /         y  ..       s   t    ..   /     
 h   h   t     t   p     sssss  ::   /     /     yyyyy  ..   sssss   t    ..   /     
                                                                                     
	<https://y.st./>
	Copyright © 2017 Alex Yst <mailto:copyright@y.st>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <https://www.gnu.org./licenses/>.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="https://y.st./en/weblog/2017/07-July/20.xhtml" />
		<title>Hair care and a potential unibrow &lt;https://y.st./en/weblog/2017/07-July/20.xhtml&gt;</title>
		<link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
		<link rel="stylesheet" type="text/css" href="/link/basic.css" />
		<link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
		<script type="text/javascript" src="/script/javascript.js" />
		<meta name="viewport" content="width=device-width" />
	</head>
	<body>
		<nav>
			<p>
				<a href="/en/">Home</a> |
				<a href="/en/a/about.xhtml">About</a> |
				<a href="/en/a/contact.xhtml">Contact</a> |
				<a href="/a/canary.txt">Canary</a> |
				<a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
				<a href="/en/opinion/">Opinions</a> |
				<a href="/en/coursework/">Coursework</a> |
				<a href="/en/law/">Law</a> |
				<a href="/en/a/links.xhtml">Links</a> |
				<a href="/en/weblog/2017/07-July/20.xhtml.asc">{this page}.asc</a>
			</p>
			<hr/>
			<p>
				Weblog index:
				<a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
				<a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
				<a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
			</p>
			<hr/>
			<p>
				Jump to entry:
				<a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
				<a rel="prev" href="/en/weblog/2017/07-July/19.xhtml">&lt;Previous</a>
				<a rel="next" href="/en/weblog/2017/07-July/21.xhtml">Next&gt;</a>
				<a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
			</p>
			<hr/>
		</nav>
		<header>
			<h1>Hair care and a potential unibrow</h1>
			<p>Day 00866: Thursday, 2017 July 20</p>
		</header>
<section id="general">
	<h2>General news</h2>
	<p>
		I have strange hair growing just above my nose now.
		I swear it wasn&apos;t there before.
		Am I starting to develop a unibrow?
		That&apos;ll be so weird if it&apos;s what&apos;s going on.
	</p>
	<p>
		I looked into hair care tips not too long ago, and while I&apos;m ignoring some of them, I&apos;m following others.
		One thing I&apos;m working with is the cleaning of it.
		Apparently, you shouldn&apos;t use shampoo unless your hair&apos;s actually dirty, but you should use conditioner every time.
		It&apos;s been only a few days of following this advice, and already, my hair looks loads nicer.
	</p>
	<p>
		I agreed to meet my mother today, but like usual, she&apos;s not responding to messages.
		The problem is that she&apos;s on the nation&apos;s screwiest carrier and doesn&apos;t use email.
		My messages often don&apos;t reach her via <abbr title="Short Message Service">SMS</abbr>, but that&apos;s the method she insists I try to reach her with.
		I asked before coming over, got no response, went to her place anyway, rang the doorbell, and again got no response.
		Whatever.
		More study time for me, though I&apos;d have even more if I wasn&apos;t wasting time trying to meet her.
		I didn&apos;t even want to go when I agreed to, but she really wanted it.
		In the evening, she wrote to me to see if I was home, even though I told her I wouldn&apos;t be.
		I told her I had the morning off and had to be at work in the evening.
		If she wants to e away in the morning when we agreed to meet up, that doesn&apos;t mean she can reschedule to meet me at night when she knows I&apos;m busy.
	</p>
	<p>
		At work, I thought about something that seems to add up with my newly-discovered hodgepodge brain.
		I forget why, but at one point as a child, my mother had my testosterone levels checked.
		They turned out to be low.
		Of course they&apos;re low though, I&apos;m half feminine and the expected level doesn&apos;t account for the fact that I&apos;m not fully masculine.
	</p>
	<p>
		My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
	</p>
</section>
<section id="university">
	<h2>University life</h2>
	<p>
		I wrote up my initial discussion post for the week:
	</p>
	<blockquote>
		<p>
			A <code>ServerSocket</code> doesn&apos;t actually manage any connections, and instead just acts as a listener.
			It waits for connection requests from clients, then spawns <code>Socket</code>s to manage the new connections.
			A <code>Socket</code> isn&apos;t always on the server though.
			Clients also use <code>Socket</code>s to communicate.
			One <code>Socket</code> is needed for each the client and server machine.
			It&apos;s worth noting that one machine could be both the client and the server.
			(This is usually accomplished by having the client connect to <code>localhost.</code> or <code>127.0.0.1</code>.)
			In this case, both endpoints still need a <code>Socket</code> instance.
		</p>
		<p>
			(When using the local domain, <code>localhost.</code>, the trailing dot is usually omitted.
			However, if your system can&apos;t handle it <strong>*with*</strong> the trailing dot, it&apos;s technically a bug in your system.
			Additionally, any domain using the <code>localhost.</code> <abbr title="Top Level Domain">TLD</abbr> is supposed to lead back to the originating machine, though in practice, most systems don&apos;t seem to implement this.
			For example, connecting to <code>example.localhost.</code> or <code>test.example.localhost.</code> <strong>*should*</strong> connect to the local machine, but usually won&apos;t because that feature is so rarely implemented.
			Again, that&apos;s a bug in your operating system&apos;s <abbr title="Domain Name System">DNS</abbr> resolver, not an invalid domain name.)
		</p>
		<p>
			Using the <code>ServerSocket</code> class is basically just a waiting game.
			Usually, you&apos;d want to create an instance of it using its constructor, <code>ServerSocket.ServerSocket(port)</code>, passing in an integer representing the port you want to listen on, then start up a loop and call <code>ServerSocket.accept()</code>.
			<code>ServerSocket.accept()</code> will tie up the program (or if your program is multithreaded, just that one thread of the program), and wait for an incoming connection. When it gets one, it&apos;ll return an object of type <code>Socket</code>, which you can use to complete the connection.
			If the call to <code>ServerSocket.accept()</code> isn&apos;t within a loop, your program will accept one connection, then finish up without accepting any more.
		</p>
		<p>
			If you&apos;re running the server, <code>Socket</code> objects are retuned by <code>ServerSocket.accept()</code>.
			If you&apos;re instead running the client, <code>Socket</code> objects can be obtained through the class&apos; constructor: <code>Socket.Socket(host, port)</code>.
			The host can be any valid host name, including both domain names and <abbr title="Internet Protocol">IP</abbr> addresses, and the port must be an unsigned, 16-bit integer.
			The <code>Socket</code> object contains two streams, one for input and one for output.
			<code>Socket.getInputStream()</code> and <code>Socket.getOutputStream()</code> can be used to retrieve those, respectively.
			The book didn&apos;t cover how to handle these stream objects directly, but they can be wrapped in objects of familiar classes, such as <code>Scanner</code> and <code>PrintWriter</code>.
			When you&apos;re done using the connection, <code>Socket.close()</code> should be called to free up memory and let the other machine know you&apos;re done.
		</p>
	</blockquote>
</section>
		<hr/>
		<p>
			Copyright © 2017 Alex Yst;
			You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
			If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
			My address is in the source comments near the top of this document.
			This license also applies to embedded content such as images.
			For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
		</p>
		<p>
			<abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
			This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F07-July%2F20.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F07-July%2F20.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
		</p>
	</body>
</html>

